$OpenBSD: patch-misc_c,v 1.2 2017/04/12 23:09:08 jca Exp $
--- misc.c.orig	Tue Jul 16 17:52:54 1991
+++ misc.c	Thu Apr 13 01:06:25 2017
@@ -135,11 +135,16 @@ if available, else the short filename is used.
 char *fullpath (direntry)
 struct direntry *direntry;
 {
-	static char result[PATHSIZE];
+	static char result[PATHSIZE+LFNAMESIZE+12]; /* Room for enough space.*/
 	combine (result,
 				direntry->dirlen != 0 ? direntry->dirname : "", 
 				(direntry->namlen != 0) ? direntry->lfname : direntry->fname
 			  );
+
+       if (strlen (result) >= PATHSIZE) {
+               prterror ('f', "Combined dirname and filename too long!\n");
+       }
+
 	return (result);
 }
 
